#ifndef MUSIC_PLAYER_H
#define MUSIC_PLAYER_H

#include <QWidget>
#include <QMediaPlayer>
#include <QMediaPlaylist>

#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>

#include <QTime>
#include <QTimer>
namespace Ui {
class music_player;
}

class music_player : public QWidget
{
    Q_OBJECT

public:
    explicit music_player(QWidget *parent = nullptr);
    ~music_player();

    QMediaPlayer *player;
    QMediaPlaylist *playlist;
    QNetworkAccessManager *http;
    QStringList musiclist,medialist;//保存播放列表

        void send_request();
        void handle_request(QNetworkReply *reply);
        void closeEvent(QCloseEvent *event);
        int moved;
    public slots:
        void position_change(qint64 position);
        void seek_change();
        //void musictime();
private:
    Ui::music_player *ui;
};

#endif // MUSIC_PLAYER_H
